<template>
	<scroll-view class="content">
		<c-navbar backText="返回" title="aaaaaa"></c-navbar>
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
		</view>
		
		<u-action-sheet :list="list" v-model="show"></u-action-sheet>
		<view class="">
			我是下面的内容
		</view>
		<u-tabbar
			v-model="current"
			:list="tabList"
			:mid-button="true"
			:before-switch="beforeSwitch"
			@change="changeTab"></u-tabbar>
	</scroll-view>
</template>

<script>
	import { mapMutations } from 'vuex'
	export default {
		data() {
			return {
				title: 'Hello',
				show: true,
				list: [
					{
						text: '点赞',
						color: 'blue',
						fontSize: 28
					},
					{
						 text: '分享'
					},
					{
						text: '评论'
					},
				],
				current: 0,
				tabList: [
					{
						iconPath: "home",
						selectedIconPath: "home-fill",
						text: '首页',
						count: 2,
						isDot: true,
						customIcon: false,
					},
					{
						iconPath: "photo",
						selectedIconPath: "photo-fill",
						text: '放映厅',
						customIcon: false,
					},
					{
						iconPath: "https://cdn.uviewui.com/uview/common/min_button.png",
						selectedIconPath: "https://cdn.uviewui.com/uview/common/min_button_select.png",
						text: '发布',
						midButton: true,
						customIcon: false,
					},
					{
						iconPath: "play-right",
						selectedIconPath: "play-right-fill",
						text: '直播',
						customIcon: false,
					},
					{
						iconPath: "account",
						selectedIconPath: "account-fill",
						text: '我的',
						count: 23,
						isDot: false,
						customIcon: false,
					},
				]
			}
		},
		onLoad() {
			// console.log('$util----', this.$IsPhone, getApp().globalData)
			// console.log('$http----', this.$http, 'get----',this.$get, 'post----', this.$post)
			// this.$api.login({
			// 	username: 'a',
			// 	password: 1
			// })
			setTimeout(() => {
				this.SET_USERINFO({
					userInfo: {
						name: 'aaaa',
						pwd: 123
					}
				})
				this.SET_TOKEN('111111')
			}, 1000)
		},
		methods: {
			...mapMutations(['SET_TOKEN', 'SET_USERINFO']),
			beforeSwitch(index) {
				console.log('index---', index)
				// 可以请求之后再回调
				return true
			},
			changeTab(e) {
				// 切换tab
				console.log('e----', e)
				this.$Router.push({path: '/pages/photo/photo'})
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
		height: 1000upx;
		background-color: e0e0e0;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
